#include<iostream>
#include<vector>
#include<unordered_map>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<string>

using namespace std;


class Solution {
public:
    bool canJump(vector<int>& nums) {
        int max_len = 0;
        for(int i = 0; i < nums.size(); i++){
            if(i > max_len)return false;
            max_len = max(max_len, i + nums[i]);
            if(max_len >= nums.size() - 1)return true;
        }
        return true;
    }
};

int main(){

}


//2021.1.20